<template>
	<view>
		<u-search v-model="keyword" :placeholder="placeholder" :showAction="showAction" shape="square"
			@focus="toSearch"></u-search>
	</view>
</template>

<script>
	export default {
		name: "search",
		props: {
			placeholder: {
				type: String,
				default: "搜索"
			},
			showAction: {
				type: Boolean,
				default: false
			},
			type: {
				type: String,
				default: 'navigator'
			}
		},
		data() {
			return {
				keyword: ''
			};
		},
		methods: {
			toSearch() {
				if (this.type == 'navigator') {
					uni.navigateTo({
						url: "/pages/search/search"
					})
				} else {
					console.log('搜索');
				}
			}
		}
	}
</script>

<style lang="scss" scoped>

</style>